package 引用;

import java.lang.ref.SoftReference;

/**
 * @author:谢君臣
 * @Date:2021/10/2-22:56
 * @version:1.0
 * @function:
 */
public class 软引用 {
    // -Xmx15M
    public static void main(String[] args) {
        SoftReference<byte[]> reference = new SoftReference<byte[]>(new byte[1024 * 1024 * 10]);
        System.out.println(reference.get());
        System.gc();
        System.out.println(reference.get());
        byte[] byte2 = new byte[1024 * 1024 * 10];
        System.out.println(reference.get());
    }
}
